package com.lcf.app.shiro.controller;

import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ChenFei
 * @date 2021/11/2
 * <p>
 * 角色注解测试
 */
@RestController
@RequestMapping("role")
public class RoleController {

    @GetMapping("user")
    @RequiresRoles(value = {"user"})
    public String user() {
        return "user role";
    }

    @GetMapping("admin")
    @RequiresRoles(value = {"admin"})
    public String admin() {
        return "admin role";
    }

}
